package easy;

public class Solution_1491 {

    public double average(int[] salary) {
        int sum = 0, min = 1000000, max = 1000;
        for (int num : salary) {
            sum += num;
            if (num < min) {
                min = num;
            }
            if (num > max) {
                max = num;
            }
        }
        return (0.0 + sum - min - max) / (salary.length - 2);
    }

    public static void main(String[] args) {
        Solution_1491 model = new Solution_1491();

    }
}
